package Demo01;

import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        try {
            System.out.println("111");
        } catch (Exception e) {
            System.out.println("处理异常");
        }
    }
    public static void main04(String[] args) {

        try {
            int[] arr = null;
            System.out.println(arr[0]);
            System.out.println("abc");
        } catch (NullPointerException e) {
            System.out.println("处理异常");
        } catch (Exception e) {
            System.out.println("处理异常");
        }
    }
    public static void main03(String[] args) {
        System.out.println("开始");
        try {
            int[] arr = new int[5];
            System.out.println(arr[10]);
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("异常处理");
            e.printStackTrace();
        }
        System.out.println("结束");
    }
    public static void main02(String[] args) {
        System.out.println("1");
        try {
            int[] arr = new int[1];
            System.out.println(arr[10]);
        } catch (ArrayIndexOutOfBoundsException |ArithmeticException e) {
            System.out.println("处理异常2");
        }

        System.out.println("2");
    }
    public static void main01(String[] args) throws CloneNotSupportedException {
        func();
    }
    public static void func() throws CloneNotSupportedException {
        throw new CloneNotSupportedException("func");
    }
}
